<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN PAGE CONTENT-->
<div class="site_content">
    <div class="realtime_content content_box no_table_filter">
        <div>
           <form  id="formid" method="post" class="instruct_box w5c-form demo-form" id="form_id" method="post"  role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
                <hr />
                <div style="width: 400px">
                    <div class="form-group form1">
                        <label>设备地址</label>
                        <input type="text" class="form-control" id="chargerId" name="chargerId" placeholder="请输入chargerId" required="" ng-model="chargerId">
                    </div>
                    <div class="form-group form1">
                        <label>查询设置</label> <input type="text" class="form-control" id="queryOrSet" name="queryOrSet" placeholder="请输入queryOrSet" required="" ng-model="queryOrSet">
                    </div>
                    <div class="form-group form1">
                        <label>查询设置类型</label> <input type="text" class="form-control" id="queryOrSetParamType" name="queryOrSetParamTypequeryOrSetParamType" placeholder="请输入queryOrSetParamType" required="">
                    </div>
                </div>
                <div class="modal-footer t_l">
                    <button style="margin-bottom:0px" type="reset" class="btn btn-warning" data-dismiss="modal">
                        <i class="fa fa-refresh"></i> 重置
                    </button>
                    <button type="button" class="btn btn-danger" onclick="data_btn()">
                        <i class="fa fa-times-circle"></i> 查询
                    </button>
                    <button type="button" class="btn btn-primary" onclick="data_btn()">
                        <i class="fa fa-user"></i> 设置
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script>
function data_btn(){
    $('button.btn-primary').on('click',function(){
        $.ajax({
            type:'post',
            url:'../chargeControll/queryOrSetParam',
            data:$('#form_id').serialize(),
            dataType: "json",
            async: false,
            success:function(data){
                if(data.code == '200'){
                    bootboxWindow.alert("指令下发成功!", null);
                }else{
                    bootboxWindow.alert("指令下发失败!", null);
                    $('#account').val('');
                    $('#password').val('');
                }
            },
            error: function(){
                bootboxWindow.alert("指令下发失败!", null);
            }

        })
    });
    $('button.btn-danger').on('click',function(){
        $.ajax({
            type:'post',
            url:'../chargeControll/queryOrSetParam',
            data:$('#form_id').serialize(),
            dataType: "json",
            async: false,
            success:function(data){
                if(data.code == '200'){
                    bootboxWindow.alert("指令下发成功!", null);
                }else{
                    bootboxWindow.alert("指令下发失败!", null);
                    $('#account').val('');
                    $('#password').val('');
                }
            },
            error:function(){
                bootboxWindow.alert("连接服务器失败",null);             }
        })

    });
    }
</script>
</html>
